package com.rayboo.example.design.pattern.state;

public class TvController implements PowerController, TvState {

    private TvState mState;

    public TvController() {
        mState = new PowerOffState();
    }

    @Override
    public void powerOn() {
        System.out.println("- 检测到电视已开机");
        mState = new PowerOnState();
    }

    @Override
    public void powerOff() {
        System.out.println("- 检测到电视已关机");
        mState = new PowerOffState();
    }


    @Override
    public void onNextChannel() {
        mState.onNextChannel();
    }

    @Override
    public void onPrevChannel() {
        mState.onPrevChannel();
    }

    @Override
    public void onTurnUp() {
        mState.onTurnUp();
    }

    @Override
    public void onTurnDown() {
        mState.onTurnDown();
    }
}
